//
//  RootViewController.m
//  UI1_View_Label课后作业第三遍
//
//  Created by dllo on 15/11/7.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RootViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor colorWithRed:239 % 256 / 255.0 green:239 % 256 / 255.0 blue:239 % 256 / 255.0 alpha:1.0];
    
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(30, 100, 90, 30)];
//    label1.backgroundColor = [UIColor redColor];
    [self.view addSubview:label1];
    label1.text = @"用户名:";
    label1.textColor = [UIColor blackColor];
    [label1 release];
    label1.textAlignment = NSTextAlignmentRight;
    label1.font = [UIFont systemFontOfSize:18];
    
    UITextField *field1 = [[UITextField alloc] initWithFrame:CGRectMake(140, 100, 180, 30)];
    field1.placeholder = @"请输入";
    field1.clearButtonMode = UITextFieldViewModeAlways;
    field1.returnKeyType = UIReturnKeyGo;
    field1.keyboardAppearance = UIKeyboardAppearanceDefault;
    field1.borderStyle = UITextBorderStyleRoundedRect;
    [self.view addSubview:field1];
    [field1 release];
    
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(30, 160, 90, 30)];
    label2.text = @"密码:";
    label2.textColor = [UIColor blackColor];
    label2.textAlignment = NSTextAlignmentRight;
    label2.font = [UIFont systemFontOfSize:18];
    [self.view addSubview:label2];
    [label2 release];
    
    UITextField *field2 = [[UITextField alloc] initWithFrame:CGRectMake(140, 160, 180, 30)];
    field2.placeholder = @"请输入密码";
    [field2 setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
    field2.clearButtonMode = UITextFieldViewModeAlways;
    field2.returnKeyType = UIReturnKeyNext;
    field2.keyboardAppearance = UIKeyboardAppearanceLight;
    field2.keyboardType = UIKeyboardTypeNumberPad;
    field2.borderStyle = UITextBorderStyleRoundedRect;
    field2.secureTextEntry = YES;
    field2.textColor = [UIColor greenColor];
    [self.view addSubview:field2];
    [field2 release];
    
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
